/**
 */
package com.dingpeikeji.quickdeer.core.modules.payinfo.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.core.modules.payinfo.dao.TPayinfoDao;
import com.dingpeikeji.quickdeer.core.modules.payinfo.entity.TPayinfo;

/**
 * 支付信息Service
 * @author wuh
 * @version 2016-07-12
 */
@Service
@Transactional(readOnly = true)
public class TPayinfoService extends CrudService<TPayinfoDao, TPayinfo> {

	public TPayinfo get(String id) {
		return super.get(id);
	}
	
	public List<TPayinfo> findList(TPayinfo tPayinfo) {
		return super.findList(tPayinfo);
	}
	
	public Page<TPayinfo> findPage(Page<TPayinfo> page, TPayinfo tPayinfo) {
		return super.findPage(page, tPayinfo);
	}
	
	@Transactional(readOnly = false)
	public void save(TPayinfo tPayinfo) {
		if(tPayinfo.getDiscountid() == null) {
			dao.insert(tPayinfo);
		} else {
			dao.update(tPayinfo);
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(TPayinfo tPayinfo) {
		super.delete(tPayinfo);
	}
	
}
